package com.whmskj.xjlhsc.gongweiji.produce.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.gongweiji.produce.mapper.GWJProductionMapper;
import com.whmskj.xjlhsc.gongweiji.produce.pojo.dto.*;
import com.whmskj.xjlhsc.gongweiji.produce.service.IGWJProductionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author jiaruchun
 * @date 2025-09-24 21:32
 */
@SaIgnore
@RestController
@RequestMapping("/gwj/production")
public class GWJProductionController {
    @Autowired
    private IGWJProductionService gwjProductionService;

    /*产量日报*/
    @PostMapping("/daily")
    public Result daily(@RequestBody(required = false) DailyDTO dto) {
        return Result.success(gwjProductionService.daily(dto));
    }

    /*车间列表*/
    @GetMapping("/workshop")
    public Result getWorkshopList() {
        return Result.success(gwjProductionService.getWorkshopList());
    }

    /*产量月报*/
    @PostMapping("/month")
    public Result month(@RequestBody(required = false) MonthDTO dto) {
        return Result.success(gwjProductionService.month(dto));
    }

    /*根据工序查对应品种*/
    @GetMapping("/processVariety")
    public Result processVariety(@RequestParam("process") String process) {
        return Result.success(gwjProductionService.processVariety(process));
    }

    /*完成率*/
    @PostMapping("/completionRate")
    public Result completionRate(@RequestBody(required = false) CompletionRateDTO dto) {
        return Result.success(gwjProductionService.completionRate(dto));
    }

    /*折合产量统计*/
    @PostMapping("/conversionRate")
    public Result conversionRate(@RequestBody(required = false) ConversionRateDTO dto) {
        return Result.success(gwjProductionService.conversionRate(dto));
    }

    /*细纱日报*/
     @PostMapping("/detailDaily")
    public Result detailDaily(@RequestBody(required = false) DetailDailyDTO dto) {
        return Result.success(gwjProductionService.detailDaily(dto));
    }
}
